#!/usr/bin/env python
# -*- coding:utf-8 -*-

"""
import numpy
# 创建一维数组格式
# numpy.array([元素1,元素2,...,])
x = numpy.array(["a","9","8","2"])
# 创建二维数组格式
# numpy.array([[元素1,元素2,...],[元素1,...])
y = numpy.array([[3,13,10],[9,2,67],[2,6,11]])
print(x)
# 排序sort()
x.sort()
y.sort()
# 取最大值和最小值
y1 = y.max()
y2 = y.min()
print(y1)
print(y2)
# 切片
# 数组[起始下标:最终下标+1]
x1 = x[1:3] # 1-2
x2 = x[:2]
x3 = x[1:]
"""


import pandas as pda 
'''
Series # index索引.
DataFrame
'''
a = pda.Series([8,9,2,1])
b = pda.Series([8,9,2,1],index=["one","two","three","four"])
c = pda.DataFrame([[5,6,2,3],[8,4,6,3],[6,4,31,2]])
d = pda.DataFrame([[5,6,2,3],[8,4,6,3],[6,4,31,2]],columns=["one","two","three","four"])

print(a)
print('=='*20)
print(b)
print('=='*20)
print(c)
print('=='*10)
print(d)
print('--'*10)
print(d.head()) # 头部数据,默认前五行.
print('--'*10) 
print(d.head(2)) # d.head(行数)
print('--'*10)
print(d.tail()) # 尾部数据,默认是后五行.
print('='*10)
print(d.tail(2)) # d.tail(行数)
d.describe()



e = pda.DataFrame({
    "one":4,
    "two":[6,2,3],
    "three":list(str(982))
})
print(e)

